/*
 * Created: Author: Ivan Lampert / Date: Jan 26, 2015
 * 
 * Changed: $Author: ac280593@gmail.com $ / $Date: 2015-03-16 22:11:42 -0300 (Mon, 16 Mar 2015) $
 */
package com.cpm.aggregate;

import com.cpm.wrapper.SolidNumbers;
import java.awt.Dimension;

public final class Size implements StyleAttribute {
    private static final long serialVersionUID = -3905865474486268413L;
    
    private final Dimension dimension = new Dimension();

    public Size(int width, int height) {
        SolidNumbers.positiveOnly(width, height);
        this.dimension.setSize(width, height);
    }
    
    public Size(Dimension dimension) {
        this(dimension.width, dimension.height);
    }

    @Override
    public String getValue() { return "width: " + dimension.width + "px; " + 
                                      "height: " + dimension.height + "px;"; }
    
    public final Dimension getDimension() { return (Dimension) dimension.clone(); }
    
}
